package com.xiaoyi.model;

import com.xiaoyi.annotataion.Encrypt;
import com.xiaoyi.enums.AlgorithmEnum;


/**
 * 用户模型
 *
 * @author JustryDeng
 * @date 2019/6/21 16:42
 */

public class Employee {

    /** 用户id */
    private Integer id;

    /** 名字 */
    @Encrypt(algorithm = AlgorithmEnum.RSA,publicKey = "",privateKey = "")
    private String name;

    /** 年龄 */
    private Integer age;

    /** 性别 */
    private String gender;

    /** 座右铭 */
    @Encrypt(algorithm = AlgorithmEnum.AES)
    private String motto;

    /** 生日 */
    private String birthday;

    /** 爱好 */
    @Encrypt(algorithm = AlgorithmEnum.AES)
    private String hobby;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getMotto() {
        return motto;
    }

    public void setMotto(String motto) {
        this.motto = motto;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getHobby() {
        return hobby;
    }

    public void setHobby(String hobby) {
        this.hobby = hobby;
    }


    public static  EmployeeBuilder builder(){
        return new EmployeeBuilder();
    }

    public static class EmployeeBuilder {
        private Integer id;
        private String name;
        private Integer age;
        private String gender;
        private String motto;
        private String birthday;
        private String hobby;

        private EmployeeBuilder() {
        }

        public  EmployeeBuilder anEmployee() {
            return new EmployeeBuilder();
        }

        public EmployeeBuilder id(Integer id) {
            this.id = id;
            return this;
        }

        public EmployeeBuilder name(String name) {
            this.name = name;
            return this;
        }

        public EmployeeBuilder age(Integer age) {
            this.age = age;
            return this;
        }

        public EmployeeBuilder gender(String gender) {
            this.gender = gender;
            return this;
        }

        public EmployeeBuilder motto(String motto) {
            this.motto = motto;
            return this;
        }

        public EmployeeBuilder birthday(String birthday) {
            this.birthday = birthday;
            return this;
        }

        public EmployeeBuilder hobby(String hobby) {
            this.hobby = hobby;
            return this;
        }

        public Employee build() {
            Employee employee = new Employee();
            employee.setId(id);
            employee.setName(name);
            employee.setAge(age);
            employee.setGender(gender);
            employee.setMotto(motto);
            employee.setBirthday(birthday);
            employee.setHobby(hobby);
            return employee;
        }
    }
}
